package com.blogSystem.article.util;

import com.mayabot.mynlp.fasttext.FastText;
import com.mayabot.mynlp.fasttext.FloatStringPair;

import java.io.File;
import java.util.Arrays;
import java.util.List;

public class Predict {

    public void makePredict(String content){

        try {
            FastText fastText=FastText.loadFasttextBinModel("H:\\GoogleNews-vectors-negative300.bin");
            List<FloatStringPair> predicts=fastText.predict(Arrays.<String>asList(content.split(" ")),5);
            for( FloatStringPair predict:predicts)
            {
                System.out.println(predict);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
